package chabernac.android.wordbattle;

import java.util.List;

import android.content.Context;
import android.os.Vibrator;

import chabernac.android.wordbattle.model.Letter;
import chabernac.android.wordbattle.model.Word;
import chabernac.android.wordbattle.model.iWordRasterListener;

public class VibrateOnWordFoundListener implements iWordRasterListener {
  @Override
  public void selectionChanged(List<Letter> aLetters) {
    getVibrator().vibrate(new long[]{0,20}, -1);
  }

  @Override
  public void wordFound(Word aWord) {
    getVibrator().vibrate(new long[]{30,20,30,20,30,20,30,20,30,20}, -1);
  }
  
  public Vibrator getVibrator(){
    return (Vibrator) WordRasterContext.getInstance().getContext().getSystemService(Context.VIBRATOR_SERVICE);
  }

}
